package com.tedu.api;

import org.junit.Test;

public class zuoye {


    //1
    @Test
    public void test1(){
        String s="HelloJava";
        System.out.println(s.length());

    }
    //2
    @Test
    public void test2() {
        String str = "HelloJava";
        int index = str.indexOf("o");
        System.out.println("返回坐标位置：" + index);

    }
    //3
    @Test
    public void test3(){
        String str="HelloJava";
        int index=str.indexOf("o",5);
        System.out.println("返回坐标位置："+index);

    }
    //4
    @Test
    public void test4() {
        String url ="HelloJava";

        String s = url.substring(0, 5);

        System.out.println("截取：" + s);
    }
    //5
    @Test
    public void test5() {
        String url = "HelloJava";

        String s1=url.substring(5);

        System.out.println("截取："+s1);

    }
    //6
    @Test
    public void test6(){
        String str=" Hello ";
        str=str.trim();
        System.out.println(str);

    }

    //7
    @Test
    public void test7(){
        String str="HelloJava";
        char c=str.charAt(5);
        System.out.println("获取字符："+c);

    }
    //8
    @Test
    public void test8(){
        String str="HelloJava";
        str=str.toUpperCase().trim();
        System.out.println("大写："+str);
        str=str.toLowerCase().trim();
        System.out.println("小写："+str);

    }
}